package engine.data;

import java.io.IOException;

import javax.microedition.lcdui.Image;

public final class Resource {

	public static final byte UNDEFINED = -1;

	public static final byte FOOD = 0;

	public static final byte PRODUCTION = 1;

	public static final byte TRADE = 2;

	public static final byte SIZE = 6;

	public static final byte IMAGE_WIDTH = 7;

	public static final byte IMAGE_HEIGHT = 7;

	public static final byte KNOWLEDGE = 3;

	public static final byte GOLD = 4;

	public static final byte LUXURY = 5;

	public byte id;

	public Image image;

	public Resource(final byte resourceId) throws IOException {
		this.id = resourceId;
		StringBuffer sb = new StringBuffer();
		sb.append("/images/resource_");
		sb.append(this.id);
		sb.append(".png");
		this.image = Image.createImage(sb.toString());
	}

	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("Resource[id=").append(this.id).append("]");
		return sb.toString();
	}
}
